package com.da.springcloud.util;

import com.da.springcloud.entities.CommonResult;

/**
 * @author JokerDa.
 * @date 2021/1/8 14:41
 * Description:
 */
public class ResultUtil {
    public static <T> CommonResult<T> success(String msg, T data) {
        return new CommonResult<>(200, msg, data);
    }

    public static <T> CommonResult<T> success(String msg) {
        return new CommonResult<>(200, msg, null);
    }

    public static <T> CommonResult<T> error(String msg, T data) {
        return new CommonResult<>(500, msg, data);
    }

    public static <T> CommonResult<T> error(String msg) {
        return new CommonResult<>(500, msg, null);
    }
}
